Fix 11373 - Desuperheater doesn't work with air-cooled refrigeration condenser#11376
Conversation
…Refrigeration equipment
…air-cooled-refrigeration-condenser
…CoilInput and let InitHeatingCoil handle it instead
src/EnergyPlus/DataZoneEquipment.cc
Outdated
|
|
||
| CurrentModuleObject = "ZoneHVAC:EquipmentConnections"; | ||
| for (int controlledZoneLoop = 1; controlledZoneLoop <= numControlledZones; ++controlledZoneLoop) { | ||
| CurrentModuleObject = "ZoneHVAC:EquipmentConnections"; |
There was a problem hiding this comment.
Why move this? This loop is only for ZoneHVAC:EquipmentConnections objects so setting this once, before the loop, seems reasonable. It's not a big deal but why set a string multiple times inside the loop?
There was a problem hiding this comment.
This was originally inside the loop. I moved it as part of a different commit which I later rolled back. I'll get this cleaned up.
| state.dataHeatingCoils->ValidSourceType(CoilNum) = true; | ||
| } | ||
| } | ||
| // Refrigeration equipment hasn't been loaded yet, so handle this in InitHeatingCoil |
There was a problem hiding this comment.
I agree with this comment. However, all the coils will be gotten in getInput, but for this coil InitHeatingCoil will also be called. So if Refrigeration equipment hasn't been loaded yet then it also won't be loaded yet when InitHeatingCoil is called for this coil. If, say, coil 5 is the desuperheating coil, then by the time coil 5 is called then refrigeration equipment will likely be set up. But what if coil 1 is the desuperheating coil? Not sure how to delay this setup in InitHeatingCoils, or even if that section of code executes each iteration (I hope not) but these code execution timing issues pop up now and then and we need to be sure it works regardless of which coil (index) is called first (i.e., refrigeration equipment must be gotten before this setup in InitHeatingCoils can execute correctly). The code I am referencing is new line 1386 in this branch (old line 1482 in develop).
There was a problem hiding this comment.
The timing issue I ran into wasn't with the coils, but the ZoneHVAC:EquipmentConnections objects. As long as those were all loaded before refrigeration (and coils) the order of the coils didn't seem to matter.
There was a problem hiding this comment.
OK, as long as this was thought about again so this doesn't pop up in the future.
There was a problem hiding this comment.
This is a larger, longer-term "fix" but you can use init_state to control the order in which objects get read from the IDF file and initialized. A few object types (mostly ones that don't reference other objects like Schedule, FluidProperties, Material, etc.) are already done this way.
…air-cooled-refrigeration-condenser
mitchute
left a comment
There was a problem hiding this comment.
I don't see any problems here. Nice to have a PR that enhances functionality with a net-reduction in code (excepting the unit tests) :)
|
I suspect something is going on with when I have multiple CI machines running, but when I only have one running, it seems to be working. Bumping CI again here to test my theory. |
|
One more test with a different CI machine running. |
|
Alright, I hate it, but we're doing one more test here. This CI machine passed on another branch, but not here, so... still working to figure out what is going on. |
|
All good here. Merging. |
Pull request overview
Description of the purpose of this PR
The control zone loop in GetZoneEquipmentData calls into GetRefrigeratedRackIndex which calls into CheckRefrigerationInput to load refrigeration components. This works when GetZoneEquipmentData only has one control zone to process, but when there are multiple control zones, the refrigeration components fail to load correctly and severe errors occur. I tried to refactor this loop into two loops, but unit test and regression test failures ensued. Then I noticed that there is already redundant logic in InitHeatingCoil to handle situations like this, so I simply removed the logic around GetRefrigeratedRackIndex and the problem was solved. GetRefrigeratedRackIndex wasn't referenced anywhere else, so I removed that as well.
Pull Request Author
Reviewer